#!/bin/bash
echo "hell bash shell "
var1="123 years old ";
echo $var1;
echo I am ${var1}ok
var2="again";
echo $var2
readonly readvar3="readonly var";
echo $readvar3;

echo $var1 $var2;
var4=$var1,$var2;
echo $var4
echo ${#var4}
echo ${var4}

echo 数组
array_=(
0,
1,
2,
3,
4,
5,
6
)
varindex=56;
#获取数组下标值
echo ${array_[$varindex]};
#获取数组的长度 方法1 @ 方法2 *
echo ${array_[@]};
echo ${#array_[*]}
echo $0;
echo $1
echo $$



int=1
while(( $int<=5 ))
do
echo $int
let "int++"
done

int=1;
while(( $int<100 ))
do
echo While $int
let "int++"
done
int=0;

a=0

until [ ! $a -lt 10 ]
do
echo until $a
a=`expr $a + 1`
done


for i in 1 , 2 , 3 , 4,5,6,7
do
echo $i
done

for(( a=0; $a<10;a=$a+1))
do
echo For $a
#let "a=a+1"
done

#无限循环列子：
#for((; ;))
#do
#echo ffff
#done


#while(true)
#do
#echo whiletrue
#done

# 直到0大于1
#until [ 0 -gt 1 ]
#do
#echo untiltrue
#
#done


while(true)
do
echo 请输入一个1-00数字
read num
case $num in
11) echo 输入的是 $num
;;
22) echo 输入的是 $num
;;
*) echo other : $num
   break;
esac
done




